<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

<head>
	<th:block data-th-replace="/adminlte/base::base-head"></th:block>
	<!-- Ekko Lightbox -->
	<link rel="stylesheet" href="/plugins/ekko-lightbox/ekko-lightbox.css">
</head>

<body class="hold-transition sidebar-mini layout-fixed">
	<div class="wrapper">
		<th:block data-th-replace="/adminlte/base::base-navbar"></th:block>
		<th:block data-th-replace="/adminlte/base::base-main-sidebar"></th:block>
		<div class="content-wrapper">
			<th:block data-th-replace="/adminlte/base::base-content-header"></th:block>
			<section class="content">
				<div class="container-fluid">
					<div class="row">
						<div class="col-sm-12">
							<div class="card">
								<div class="card-header">
									<div class="row mt-2">
										<button class="btn btn-app" data-dialog-confirm="/files/marks:delete"
											data-dialog-t-msg="确定要删除所选文件映射吗？" data-handle="data.ids"
											data-check-ids="table tbody input">
											<i class="fas fa-times text-blue"></i> 删除映射
										</button>
										<div class="w-100"></div>
										<div class="input-group mx-2 mb-2">
											<div class="input-group-prepend">
												<button type="submit" class="btn btn-default"
													data-get-uuid="#search-file-mark" onclick="changeThis(this)">
													<i class="fas fa-search"></i>
												</button>
											</div>
											<input id="search-file-mark" type="text" name="table_search"
												class="form-control" placeholder="Search" autofocus="autofocus"
												data-get-search="#search-file-mark"
												onkeyup="enterThis(this, changeThis)">
										</div>

									</div>
								</div>
								<div class="card-body">
									<div class="table-responsive">
										<table id="file-table" class="table table-bordered table-hover table-striped">
											<colgroup>
												<col width="50" />
												<col width="150" />
												<col width="250" />
												<col />
												<col width="250" />
												<col width="100" />
												<col width="160" />
											</colgroup>
											<thead>
												<tr>
													<th><input type="checkbox" name="id" /></th>
													<th>用户ID</th>
													<th>UUID</th>
													<th>文件名字</th>
													<th>文件类型</th>
													<th>文件后缀</th>
													<th>操作</th>
												</tr>
											</thead>
											<tbody>
												<tr data-th-each="fileMark : ${markPage.data}">
													<td><input type="checkbox" name="ids" th:value="${fileMark.id}" />
													</td>
													<td><a th:href="${'/admin/file/mark?userId='+fileMark.userId}"
															th:utext="${fileMark.userId}"> </a></td>
													<td th:href="${'/files/'+fileMark.uuid+fileMark.suffix}"
														data-toggle="lightbox" data-gallery="gallery"
														th:data-is-image="${StringUtils.startWith(fileMark.type, 'image')}"
														class="text-blue" data-th-utext="${fileMark.uuid}"
														style="cursor: pointer;" th:data-title="${fileMark.uuid}">
													</td>
													<td data-th-utext="${fileMark.name}"></td>
													<td data-th-utext="${fileMark.type}"></td>
													<td data-th-utext="${fileMark.suffix}"></td>
													<td>
														<a title="预览" target="_blank"
															th:href="${'/admin/file/view/' + fileMark.uuid}">
															<i class="fas fa-eye text-blue"
																style="margin-left: 10px;"></i>
														</a>
														<a title="下载" target="_blank"
															th:download="${fileMark.uuid+fileMark.suffix}"
															th:href="${'/files/'+fileMark.uuid+fileMark.suffix}">
															<i class="fas fa-download text-blue"
																style="margin-left: 10px;"></i>
														</a>
														<a title="复制"
															th:data-copy="${WebUtils.getHead()+'/files/'+fileMark.uuid+fileMark.suffix}"
															href="#" onclick="copyText(this)">
															<i class="fas fa-copy text-blue"
																style="margin-left: 10px;"></i>
														</a>
														<a title="删除" th:data-path="${fileMark.id}"
															data-dialog-confirm="/files/marks/:delete"
															data-dialog-t-msg="您确定要删除当前文件映射吗？"> <i
																class="fas fa-trash text-blue"
																style="margin-left: 10px;"></i>
														</a>
													</td>
												</tr>
											</tbody>
										</table>
									</div>
									<th:block data-th-replace="/adminlte/base::pageNav(${markPage},'个文件映射')"></th:block>
								</div>
							</div>
						</div>
					</div>
				</div>
			</section>
		</div>
		<th:block data-th-replace="/adminlte/base::base-footer"></th:block>
		<th:block data-th-replace="/adminlte/base::base-control-sidebar"></th:block>
	</div>

	<script src="/kaibes/js/extend.js"></script>
	<script src="/kaibes/js/table-check.js"></script>
	<script src="/plugins/ekko-lightbox/ekko-lightbox.js"></script>
	<script src="/plugins/spark-md5/spark-md5.min.js"></script>
	<script src="/file-local/js/upload-file.js"></script>
	<script>
		$(function () {
			showBox('[data-toggle="lightbox"]');
		})
	</script>

</body>

</html>